package projet;

import java.sql.*;


class Test {
	private static final Connection NULL = null;

	public static void main (String[]args) {
		Fenetre fen= new Fenetre();
		//hebergerBase();
		}
	
	  public static void hebergerBase(){
	  String url = "jdbc:mysql://localhost:3306/projet";
      String user = "root";
      String mdp = "";
      
      
	try {
		
	      Class.forName("com.mysql.jdbc.Driver").newInstance();
	    
	      Connection conn = DriverManager.getConnection(url, user, mdp);
	         
	      Statement state = conn.createStatement();
	      
	      ResultSet result = state.executeQuery("SELECT DISTINCT sujet FROM sujetco WHERE sujetco.id=1");
	      
	      while(result.next()){
	    	  String nomSujet = result.getString(1);
	    	  FenetreSujet nomS = new FenetreSujet(nomSujet);
	    	  nomS.setVisible(false);
	      }
	      
	      result.close();
	      conn.close();
	      state.close();
	         
	    } catch (Exception e) {
	      e.printStackTrace();
	    }
	  }
}